Ext.regModel('jp.bbcs.rssclient.models.Feeds', {
    fields: [
    	{name: 'id', type: 'string'},
       	{name: 'title', type: 'string'},
    	{name: 'url', type: 'string'},
    	{name: 'subscried', type: 'boolean'}
    ],

	belongsTo: 'jp.bbcs.rssclient.models.FeedGroup'
});

Ext.regModel('jp.bbcs.rssclient.models.FeedGroup', {
	fields: [
		{name: 'id', type: 'string'},
		{name: 'title', type: 'string'}
	],

	hasMany: [{model: 'jp.bbcs.rssclient.models.Feeds', name: 'feeds'}]
	
});

Ext.regStore("feedStore", {
	model: 'jp.bbcs.rssclient.models.FeedGroup',
	proxy: {
		type: 'localstorage',
		id: 'feedStore'
	},
	data: [
	{
		id: 'group1',
		title: 'ニュース',
		feeds: [{
			title: 'NHKニュース',
			url: 'http://www3.nhk.or.jp/rss/news/cat0.xml',
			subscribed: true
		},
		{
			title: '読売新聞',
			url: 'http://rss.yomiuri.co.jp/rss/yol/latestnews30',
			subscribed: true
		}]
	},
	{
		id: 'group2',
		title: 'テクノロジー',
		feeds: [{
			title: 'Engadget日本語版',
			url: 'http://rss.rssad.jp/rss/engadget/rss',
			subscribed: true
		},
		{
			title: 'WIRED日本語版',
			url: 'http://wired.jp/feed/',
			subscribed: true
		}]
	},
	{
		id: 'group3',
		title: 'カスタマイズ',
		feeds: [{
			id: 'custom1',
			title: 'Yahoo!',
			url: 'http://www.yahoo.co.jp',
			category: 'custom',
			subscribed: true
		}]
	}
	]
});
